package hibernate.roomSystem;
import java.util.Date;
import hibernate.p.DocType;
import hibernate.p.TelNumber;
import java.util.Set;
import hibernate.roomSystem.RoomType;
import hibernate.roomSystem.Room;

public class ReservationForm {
	
	private static class ReservationState{
		
		private String name;
		
		private ReservationState(String n){
			name=n;
		}
		public String toString(){
			return name;
		}
		
		public static ReservationState expecting=new ReservationState("EXPECTING");
		public static ReservationState cancelled=new ReservationState("CANCELLED");
		public static ReservationState notSatisfied=new ReservationState("NOT_SATISFIED");
		public static ReservationState accepted=new ReservationState("ACCEPTED");
		public static ReservationState bad=new ReservationState("BAD");
		
	}
	
	private Date timeCreate;
	private Date timeAcommodation;
	private String firstName;
	private String lastName;
	private String middleName;
	private boolean sex;
	private TelNumber telNumber1;
	private TelNumber telNumber2;
	private RoomType room;
	private int number;
	private Set<Room> reservedRooms;
	private String docNumber;
	private DocType docType;
	private String note;
	private Date timeLeaving;
	private Long id;
	private boolean applyPartTime;
	
	public void setPartTime(Boolean applyPartTime){
		this.applyPartTime=applyPartTime;
	}
	
	public Boolean getPartTime(){
		return this.applyPartTime;
	}
	
	public RoomType getRoom(){return room;}
	
	public void setRoom(RoomType room){this.room=room;}
	
	public void setTimeCreate(Date time){this.timeCreate=time;}
	
	public Date getTimeCreate(){return timeCreate;}
	
	public void setId(Long id){this.id=id;}
	
	public Long getId(){return id;}
	
	public void setTimeAcommodation(Date time){
		timeAcommodation=time;
	}
	
	public Date getTimeAcommodation(){
		return timeAcommodation;
	}
	
	public void setFirstName(String firstN){
		firstName=firstN;
	}
	
	public String getFirstName(){
		return firstName;
	}
	
	public void setLastName(String lastN){
		lastName=lastN;
	}
	
	public String getLastName(){
		return lastName;
	}
	
	public void setMiddleName(String middleN){
		middleName=middleN;
	}
	
	public String getMiddleName(){
		return middleName;
	}
	
	public void setSex(boolean sex){
		this.sex=sex;
	}
	
	public boolean getSex(){
		return sex;
	}
	
	public void setTelNumber1(String telNum){
		telNumber1=TelNumber.parseString(telNum);
	}
	
	public String getTelNumber1(){
		return telNumber1.toString();
	}
	
	public void setTelNumber2(String telNum){
		telNumber2=TelNumber.parseString(telNum);;
	}
	
	public String getTelNumber2(){
		return telNumber2.toString();
	}
	
	public void setRoomType(RoomType room){
		this.room=room;
	}
	
	public RoomType getRoomType(){
		return room;
	}
	
	public void setNumber(int num){
		number=num;
	}
	
	public int getNumber(){
		return number;
	}
	
	public void setReservedRooms(Set<Room> rooms){
		reservedRooms=rooms;
	}
	
	public Set<Room> getReservedRooms(){
		return reservedRooms;
	}
	
	public void setDocNumber(String docNum){
		docNumber=docNum;
	}
	
	public String getDocNumber(){
		return docNumber;
	}
	
	public void setDocType(String docType){
		this.docType=DocType.get(docType);
	}
	
	public String getDocType(){
		return docType.toString();
	}
	
	public void setNote(String note){
		this.note=note;
	}
	
	public String getNote(){
		return note;
	}
	
	public void setTimeLeaving(Date date){
		timeLeaving=date;
	}
	
	public Date getTimeLeaving(){
		return timeLeaving;
	}
	
	public boolean eqauls(Object obj){
		if(!(obj instanceof ReservationForm ))
			return false;
		else 
			return this.id.equals(((ReservationForm)obj).id);
		
	}

}
